package com.jinbei.service;

import com.github.pagehelper.PageInfo;
import com.jinbei.domain.User;

import java.util.HashSet;
import java.util.List;
import java.util.Map;

/**
 * @author
 * 用户service
 * Created by zflu on 2018/7/8.
 */
public interface UserService {

    /**
     * @author zflu
     * @Description   根据用户id查询User
     * @date 2018/7/9 13:57
     * @param userId
     * @return com.jinbei.domain.User
     */
    User queryUserByUserId(int userId) throws Exception;

    /**
     * @author zflu
     * @Description   根据用户id删除User
     * @date 2018/7/9 14:01
     * @param userId
     * @return int
     */
    int deleteUserByUserId(int userId) throws Exception;

    /**
     * @author zflu
     * @Description   新增用户
     * @date 2018/7/9 14:04
     * @param user
     * @return int
     */
    int insertUser(User user) throws Exception;

    /**
     * @author zflu
     * @Description   更新用户
     * @date 2018/7/9 14:08
     * @param user
     * @return int
     */
    int updateUser(User user) throws Exception;

    /**   
     * @author zflu
     * @Description   查询被锁定的用户
     * @date 2018/7/9 14:11  
     * @param
     * @return java.util.Map  
     */ 
    Map queryUserByLock() throws Exception;

    /**
     * @author zflu
     * @Description   解锁或者上锁用户
     * @date 2018/7/9 14:36
     * @param userId
     * @return int
     */
    int lockOrUnLockUser(int userId) throws Exception;

    /**
     * @author zflu
     * @Description   登录验证账号密码是否正确
     * @date 2018/7/10 10:42
     * @param loginName, password
     * @return com.jinbei.domain.User
     */
    User queryLoginUser(String loginName,String password) throws Exception;

    /**
     * @author zflu
     * @Description   根据用户id查询授权接口
     * @date 2018/7/10 13:33
     * @param userId
     * @return java.lang.String
     */
    HashSet<String> queryUserAuthorUrl(int userId) throws Exception;

    /**
     * @author zflu
     * @Description   用户分页列表
     * @date 2018/7/11 17:03
     * @param size, offset
     * @return com.github.pagehelper.Page<com.jinbei.domain.User>
     */
    PageInfo queryUserPage(int size, int offset) throws Exception;

    /**
     * @author zflu
     * @Description   根据用户名称查询用户
     * @date 2018/7/19 9:45
     * @param loginName
     * @return com.jinbei.domain.User
     */
    User queryUserByLoginName(String loginName) throws Exception;

    /**
     * @author zflu
     * @Description   修改用户密码
     * @date 2018/8/3 11:17
     * @param map
     * @return int
     */
    int updateUserPassword(Map<String,String> map) throws Exception;

    /**
     * @author zflu
     * @Description
     * @date 2018/8/7 13:24
     * @param map
     * @return int
     */
    int updateUserRoles(Map<String,String> map) throws Exception;

    /**
     * @author zflu
     * @Description   根据部门id查询用户
     * @date 2018/8/9 13:52
     * @param id
     * @return java.util.List<com.jinbei.domain.User>
     */
    List<User> queryUserListByDeptId(Integer id) throws Exception;

}
